<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>数据上屏</title>
	<!--Electron 引用jquery-->
	<script>window.$ = window.jQuery = require('../assets/libs/jquery/jquery-3.2.1.min.js');</script>
	<script src="../assets/js/v.js"></script>
	<script src="../assets/js/dict_cfg.js"></script>
	<script src="../assets/js/constant.js"></script>
	<script src="../assets/js/lib.js"></script>
	<script src="../assets/js/index.base.js"></script>
	<script src="../assets/js/comm.request.js"></script>

	<link rel="stylesheet" href="../assets/module/message/css/message.css">
	<link type="text/css" rel="stylesheet" href="../assets/module/treeSelect/css/metroStyle/metroStyle.css">
	<link type="text/css" rel="stylesheet" href="../assets/module/treeSelect/css/treeSelectStyle.css">
	<script src="../assets/module/message/js/message.min.js"></script>
	<script type="text/javascript" src="../assets/module/treeSelect/js/jquery.ztree.all.js"></script>
	<script type="text/javascript" src="../assets/module/treeSelect/treeSelect.2.0.js"></script>
	<link href="../assets/module/loading/loading.css" media="screen" rel="stylesheet" type="text/css" />
	<script src="../assets/module/loading/loading.js"></script>

	<!--start 横屏注册页-->
	<script type="text/html" id="index_h_html">
	<div class="regDevice">
		<div class="regDevice-left">
			<div class="regDevice-leftTop">
				<img src="../assets/images/logo.png" alt="">
				<div class="regDevice-logoName">
					<p class="logoName-zh">
					{{appName}}
					</p>
					<p class="logoName-en">
					{{appNameEn}}
					</p>
				</div>
			</div>
			<div class="copyright">
				<a href="{{appWebSite}}" target="_blank">{{appCopyright}}</a>
			</div>
		</div>
		<div class="regDevice-border" id="client_location">
			<form id="verify-form">
				<div class="regDevice-form">
					<div class="form-title">
						{{regForm.title}}
					</div>
					<div class="companyCode">
						<span>{{regForm.subdomain}}</span>
						<div>
							<input type="text" name="subdomain" placeholder="请输入代码">
						</div>
					</div>
					<div class="companyPwd">
						<span>{{regForm.pwd}}</span>
						<div>
							<input type="password" name="password" placeholder="请输入密码">
						</div>
					</div>
					<div class="submitBtn" onclick="submitVerifyInfo()">
						{{regForm.submitBtn}}
					</div>
				</div>
			</form>


			<form id="regdevice_form">
				<div class="regDevice-form">
					<div class="form-title" id="tenantName"></div>
					<div class="plocation">
						<p id="name_plocation">
							{{regForm.location1}}
						</p>
						<div>
							<input id="depart" class="select_depart" type="text" name="locationName" placeholder="请选择所在机构" readonly>
						</div>
					</div>
					<div class="remark">
						<p id="remark_location">
							{{regForm.remark}}
						</p>
						<div>
							<textarea id="input_remark" cols="30" rows="10" name="locationRemark" placeholder="描述如:会议室、大厅、产线1 等"></textarea>
						</div>
					</div>
					<div class="submitBtn" id="submitDeviceInfo">
						{{regForm.submitBtn}}
					</div>
				</div>
			</form>
		</div>
		<div class="version-status">
			版本：
			<span class="version" id="client_version">
				0.0.0
			</span>
			<span class="update_info" id="update_info">
				
			</span>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			状态：
			<span id="client_status">
				正在检测状态
			</span>
		</div>
	</div>
	</script>
	<!--end 横屏注册页-->
	<!--start 竖屏注册页-->
	<script type="text/html" id="index_v_html">
		<div class="regDevice">
			<div class="regDevice-leftTop">
				<img src="../assets/images/logo.png" alt="">
				<div class="regDevice-logoName">
					<p class="logoName-zh">
					{{appName}}
					</p>
					<p class="logoName-en">
					{{appNameEn}}
					</p>
				</div>
			</div>
			<div class="regBanner"><img src="../assets/images/registerV.png" alt=""></div>
			<div  id="client_location" style="display: none;">
				<form id="verify-form" class="regForm">
					<div class="regDevice-form">
						<div class="regTitle">{{regForm.title}}</div>
						<div class="companyCode">
							<span>{{regForm.subdomain}}</span>
							<div>
								<input type="text" name="subdomain" placeholder="请输入代码">
							</div>
						</div>
						<div class="companyPwd">
							<span>{{regForm.pwd}}</span>
							<div>
								<input type="password" name="password" placeholder="请输入密码">
							</div>
						</div>
						<div class="saveBtn" onclick="submitVerifyInfo()">
							{{regForm.submitBtn}}
						</div>
					</div>
				</form>

				<form class="regForm" id="regdevice_form">
					<div class="form-title" id="tenantName"></div>
					<div class="plocation">
						<p id="name_plocation">{{regForm.location1}}</p>
						<div>
							<input id="depart" class="select_depart" type="text" name="locationName" placeholder="请选择所在机构" readonly>
<!--							<select id="select_plocation" name="plocation" onchange="changeClocationSelect(this,this.selectedIndex)">-->
<!--							</select>-->
						</div>
					</div>
<!--					<div class="clocation">-->
<!--						<span id="name_clocation">{{regForm.location2}}</span>-->
<!--						<div><select id="select_clocation" name="clocation">-->
<!--							</select></div>-->
<!--					</div>-->
					<div class="remark">
						<p id="remark_location">{{regForm.remark}}</p>
						<div><textarea id="input_remark" cols="30" rows="10" name="locationRemark" placeholder="描述如:会议室、大厅、产线1 等"></textarea></div>
					</div>
					<div class="saveBtn"  id="submitDeviceInfo">{{regForm.submitBtn}}</div>

				</form>
			</div>
			<div class="version-status">版本：<span class="version" id="client_version">0.0.0 </span> 状态：<span class="status" id="client_status">正在检测状态</span></div>
			<div class="copyright"><a href="{{appWebSite}}" target="_blank">{{appCopyright}}</a></div>
		</div>
	</script>
	<!--end 竖屏注册页-->
</head>

<body style="background-color: #007CF8;">
	<div id="content_html" style="height: 100%;color: white;">数据上屏</div>
</body>

<!-- 组件js，和业务不相关的 -->
<script src="../3rd/tio/tiows.js"></script>
<!-- 和业务相关的js，业务需要修改 -->
<script src="../assets/js/pushHandler.js"></script>
<script src="../assets/js/pushInit.js"></script>
<script src="../assets/js/index.js"></script>
<script>
	Qmsg.config({
		html: true,
		position: 'right'
	})
	var dynamicLoading = {
		css: function (path) {
			if (!path || path.length === 0) {
				throw new Error('argument "path" is required !');
			}
			var head = document.getElementsByTagName('head')[0];
			var link = document.createElement('link');
			link.href = path;
			link.rel = 'stylesheet';
			link.type = 'text/css';
			head.appendChild(link);
		},
		js: function (path) {
			if (!path || path.length === 0) {
				throw new Error('argument "path" is required !');
			}
			var head = document.getElementsByTagName('head')[0];
			var script = document.createElement('script');
			script.src = path;
			script.type = 'text/javascript';
			head.appendChild(script);
		}
	}

	var template = require('art-template');
	var s = VisualConst.getScreenType();
	try {
		if (s == 'h') {
			//水平,横屏
			dynamicLoading.css("../assets/style/index.h.css");
			var html = template.render($("#index_h_html").html(), _appConfig);
			$("#content_html").html(html);
			let bw = (document.documentElement.clientWidth / 9.6) + 'px';
			let htmlTag = document.getElementsByTagName('html')[0];
			htmlTag.style.fontSize = bw;
		} else {
			//垂直,竖屏
			dynamicLoading.css("../assets/style/index.v.css");
			var html = template.render($("#index_v_html").html(), _appConfig);
			$("#content_html").html(html);
			let bw = (document.documentElement.clientWidth / 5.4) + 'px'
			let htmlTag = document.getElementsByTagName('html')[0]
			htmlTag.style.fontSize = bw
		}
		loadMainPage();
	} catch (e) {
		//TODO handle the exception
		console.log(e);
	}
</script>
</html>